﻿using ProjBackEnd.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ProjBackEnd.Areas.ExtPub.Models
{
    /// <summary>
    /// 微信端用户登录请求
    /// </summary>
    public class ReqWxUserLogin
    {
        /// <summary>
        /// 外部平台id（前后端约定）
        /// </summary>
        public int pubid { get; set; }
        /// <summary>
        /// 微信登录码，通过wx.login获得
        /// </summary>
        public string wxcode { get; set; } = "";
        /// <summary>
        /// 手机号
        /// </summary>
        public string cellphone { get; set; } = "";
        /// <summary>
        /// 验证码
        /// </summary>
        public string vcode { get; set; } = "";
        /// <summary>
        /// 昵称
        /// </summary>
        public string nickname { get; set; } = "";
        /// <summary>
        /// 头像url
        /// </summary>
        public string avatarurl { get; set; } = "";
    }

    /// <summary>
    /// 微信用户登录结果集
    /// </summary>
    public class ResultWxUserLogin : BaseResultInfo
    {
        /// <summary>
        /// 人员id
        /// </summary>
        public int personid { get; set; }
        /// <summary>
        /// 微信开放平台用户唯一标识
        /// </summary>
        public string unionid { get; set; } = "";
        /// <summary>
        /// 微信单平台用户唯一标识
        /// </summary>
        public string openid { get; set; } = "";
        /// <summary>
        /// 是否在前端展示图表
        /// </summary>
        public bool showchart { get; set; } = false;
        /// <summary>
        /// 微信业务交互凭据
        /// </summary>
        public string wxtoken { get; set; } = "";
        /// <summary>
        /// 用户列表
        /// </summary>
        public List<SysUserInfo> memberlist { get; set; } = new List<SysUserInfo>();
        /// <summary>
        /// 通知标识列表
        /// </summary>
        public List<BizNotifyInfo> notifylist { get; set; } = new List<BizNotifyInfo>();
        /// <summary>
        /// 权限列表
        /// </summary>
        public List<PermissionInfo> permissionlist { get; set; } = new List<PermissionInfo>();
    }

    /// <summary>
    /// 用户信息
    /// </summary>
    public class SysUserInfo
    {
        /// <summary>
        /// 系统分配id（全系统唯一）
        /// </summary>
        public string memberid { get; set; } = "";
        /// <summary>
        /// 公司代码
        /// </summary>
        public string comcd { get; set; } = "";
        /// <summary>
        /// 用户id（全系统唯一）
        /// </summary>
        public string userid { get; set; } = "";
        /// <summary>
        /// 用户名称
        /// </summary>
        public string username { get; set; } = "";
    }

    /// <summary>
    /// 业务通知信息（待扩展）
    /// </summary>
    public class BizNotifyInfo
    {
        /// <summary>
        /// 业务关键字
        /// </summary>
        public string bizkey { get; set; } = "";
        /// <summary>
        /// 通知数
        /// </summary>
        public int noticount { get; set; }
    }

    /// <summary>
    /// 权限信息（待扩展）
    /// </summary>
    public class PermissionInfo
    {
        /// <summary>
        /// 权限关键字
        /// </summary>
        public string Permissionkey { get; set; }
    }

    //memberid增删改查
    //****

}